{include file="header.html"}
<div> {include file='shop_vip/nav.html'}
  <form method='post' action='{$appadmin}?m=shop_vip&a=save'>
    <input type='hidden' name='id' style='display:none;' value='{$data.id}' >
    <table class='table table-bordered' width='100%'>
    	<tr>
        	<td  width="100">标题</td>
            <td><input type="text" name="title" class="w300" value="{$data.title}"></td>
        </tr>
      <tr>
        <td>店铺：</td>
        <td><input type='hidden' name='shopid' id='shopid' value='{$data.shopid}' >
        <input type="text" id="keyword"> <span id="search" style="color:red; cursor:pointer">查找</span>
        <div id="reslist" class="reslist" style="position:relative"></div>
         </td>
      </tr>
      <tr>
        <td>状态：</td>
        <td>
        
        <input type='radio' name='status' {if $data.status eq 1} checked{/if} id='status' value='1' >开启
        <input type='radio' name='status' {if $data.status eq 2} checked{/if} id='status' value='2' >关闭
        </td>
      </tr>
      <tr>
        <td>类别：</td>
        <td>
        <select name="typeid">
        	<option value="0">请选择</option>
            {get data=typelist model=shop_vip fun=typelist()}
            {foreach item=c key=k from=$typelist}
            <option value="{$k}" {if $data.typeid eq $k} selected{/if}>{$c}</option>
            {/foreach}
        </select>
        </td>
      </tr>
      <tr>
        <td>开始时间：</td>
        <td><input type='text' name='starttime' id='starttime' value='{if $data.starttime}{$data.starttime|date:Y-m-d H:i:s}{/if}' onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" ></td>
      </tr>
      <tr>
        <td>到期时间：</td>
        <td><input type='text' name='endtime' id='endtime' value='{if $data.endtime}{$data.endtime|date:Y-m-d H:i:s}{/if}' onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" ></td>
      </tr>
      <tr>
        <td>收费时间：</td>
        <td><input type='text' name='intime' id='intime' value='{if $data.intime}{$data.intime|date:Y-m-d H:i:s}{/if}' onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" ></td>
      </tr>
      <tr>
        <td></td>
        <td><input type='submit' value='保存' class='btn btn-success'></td>
      </tr>
    </table>
  </form>
</div>
<script language="javascript" src="/plugin/My97DatePicker/WdatePicker.js"></script>
<script>
$(function(){
	$("#search").on("click",function(){
		$.get("{$appadmin}?m=shop&a=search&shopname="+$("#keyword").val(),function(data){
			var html='';
			for(var i=0;i<data.length;i++){
				html=html+'<div>'+data[i].shopname+'</div>';
			}
			$("#reslist").html(html);
		},"json");
	});
});
</script>

{include file="footer.html"}